/* 可折叠侧边栏样式 */

:root {
    --sidebar-width: 240px;
    --sidebar-collapsed-width: 60px;
    --sidebar-bg: #1e293b;
    --sidebar-hover: #2c3e50;
    --sidebar-active: #3498db;
    --sidebar-text: #e2e8f0;
    --sidebar-icon: #94a3b8;
    --sidebar-border: rgba(255, 255, 255, 0.1);
    --transition-speed: 0.3s;
}

/* 侧边栏容器 */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    transition: width var(--transition-speed) ease;
    overflow-x: hidden;
    position: relative;
    z-index: 100;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    margin: 0;
    padding: 0;
}

/* 折叠状态 */
.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

/* 品牌标题 */
.brand {
    height: 70px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid var(--sidebar-border);
    background-color: rgba(0, 0, 0, 0.1);
    position: relative;
}

.brand-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, #3498db, #1abc9c);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: white;
    margin-right: 12px;
    flex-shrink: 0;
}

.brand-text {
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    transition: opacity var(--transition-speed);
}

.sidebar.collapsed .brand-text {
    opacity: 0;
    width: 0;
    margin: 0;
}

/* 折叠按钮 */
.collapse-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.collapse-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.sidebar.collapsed .collapse-btn {
    transform: translateY(-50%) rotate(180deg);
}

/* 导航菜单 */
.nav-menu {
    display: flex;
    flex-direction: column;
    padding: 15px 10px;
    height: calc(100vh - 70px);
    overflow-y: auto;
}

/* 滚动条样式 */
.nav-menu::-webkit-scrollbar {
    width: 5px;
}

.nav-menu::-webkit-scrollbar-track {
    background: transparent;
}

.nav-menu::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

/* 导航项 */
.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 5px;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all var(--transition-speed);
    position: relative;
    overflow: hidden;
}

.nav-item:hover {
    background-color: var(--sidebar-hover);
}

.nav-item.active {
    background-color: var(--sidebar-active);
    color: white;
    box-shadow: 0 4px 10px rgba(52, 152, 219, 0.3);
}

.nav-item.active .nav-icon {
    color: white;
}

.nav-icon {
    font-size: 18px;
    margin-right: 12px;
    color: var(--sidebar-icon);
    transition: all var(--transition-speed);
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.nav-text {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: opacity var(--transition-speed);
}

.sidebar.collapsed .nav-text {
    opacity: 0;
    width: 0;
}

/* 导航分类 */
.nav-category {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 15px 15px 10px;
    transition: opacity var(--transition-speed);
}

.sidebar.collapsed .nav-category {
    opacity: 0;
}

/* 工具提示 */
.nav-tooltip {
    position: absolute;
    left: 70px;
    background-color: #2c3e50;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s;
    white-space: nowrap;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
    z-index: 100;
}

.sidebar.collapsed .nav-item:hover .nav-tooltip {
    opacity: 1;
    transform: translateX(5px);
}

/* 移动菜单 */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 90;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-speed);
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background-color: white;
    box-shadow: var(--shadow-sm);
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.mobile-menu-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -100%;
        transition: left var(--transition-speed) ease;
    }
    
    .sidebar.mobile-active {
        left: 0;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
} 